import request from '@/utils/request'

// 查询车辆列表
export function listVehicles(query) {
  return request({
    url: '/vehicles/customerVehicles/list',
    method: 'get',
    params: query
  })
}

// 查询车辆详细
export function getVehicle(id) {
  return request({
    url: '/vehicles/customerVehicles/detail/' + id,
    method: 'get'
  })
}

// 新增车辆
export function addVehicle(data) {
  return request({
    url: '/vehicles/customerVehicles/add',
    method: 'post',
    data: data
  })
}

// 修改车辆
export function updateVehicle(data) {
  return request({
    url: '/vehicles/customerVehicles/update',
    method: 'put',
    data: data
  })
}

// 删除车辆
export function deleteVehicle(id) {
  return request({
    url: '/vehicles/customerVehicles/delete/' + id,
    method: 'delete'
  })
}

// 批量删除车辆
export function deleteVehicles(ids) {
  return request({
    url: '/vehicles/customerVehicles/delete/' + ids,
    method: 'delete'
  })
}

// 获取客户的车辆列表
export function getCustomerVehicles(customerId) {
  return request({
    url: '/vehicles/customerVehicles/customer/' + customerId,
    method: 'get'
  })
}

// 设置默认车辆
export function setDefaultVehicle(id) {
  return request({
    url: '/vehicles/customerVehicles/default/' + id,
    method: 'put'
  })
} 